/*
 * @Description: 
 * @Author: zml
 * @Date: 2025-01-15 11:12:17
 * @LastEditors: zml
 * @LastEditTime: 2025-01-16 15:34:28
 */

import { registerMicroApps, start } from 'qiankun';

export const apps = [
    {
        name: 'subapp1',
        type: 'vue',
        devEntry: 'http://localhost:8001',
        entry: 'http://localhost:8001',
        container: '#subapp-container',
        activeRule: '/subapp1/',
    },
    {
        name: 'subapp2',
        type: 'react',
        devEntry: 'http://localhost:8002',
        entry: 'http://localhost:8002',
        container: '#subapp-container',
        activeRule: '/subapp2/',
    },
    {
        name: 'subapp3',
        type: 'svelte',
        devEntry: 'http://localhost:8003',
        entry: 'http://localhost:8003',
        container: '#subapp-container',
        activeRule: '/subapp3/',
    },
    {
        name: 'subapp6',
        type: 'vue3',
        devEntry: 'http://localhost:8006',
        entry: 'http://localhost:8006',
        container: '#subapp-container',
        activeRule: '/subapp6/',
    },
    {
        name: 'subapp7',
        type: 'vue7',
        devEntry: 'http://localhost:8007',
        entry: 'http://localhost:8007',
        container: '#subapp-container',
        activeRule: '/subapp7/',
    },
    {
        name: 'subapp8',
        type: 'vue6',
        devEntry: 'http://localhost:8008',
        entry: 'http://localhost:8008',
        container: '#subapp-container',
        activeRule: '/subapp8/',
    },
];

// 启动qiankun
export function registerMicroApp() {
    registerMicroApps(apps)
    start({
        prefetch: false, // 可选，是否预加载所有子应用
        sandbox: {
        }
    });
}
